"""
__author__ = 'heyanmin'
__time__ = '2021/6/6 4:11 下午'
"""
import json

import requests

from api_demo.api.base_api import BaseApi


class WorkApi(BaseApi):
    # token = None
    # 获取token
    def get_token(self):
        data = {
            "url": "https://qyapi.weixin.qq.com/cgi-bin/gettoken",
            "method":"get",
            "params" : {
                "corpid": "ww9af87191bd18c3d3",
                "corpsecret": "iweCWwUg3EjChL165azNdkM8xSfP05AF9F8VML9oZNA"
            }
        }
        r = self.request(data)
        assert r.status_code == 200
        self.token = r.json()['access_token']


